{if isset($orderby) AND isset($orderway)}
<!-- Sort products -->
<form id="productsSortForm" action="{$request_uri|escape:'htmlall':'UTF-8'}">
	<p>
		<select id="selectPrductSort" onchange="document.location.href = $(this).val();">
			<option value="{$link->goLink('position', 'desc')|escape:'htmlall':'UTF-8'}" {if $orderby eq 'position'    AND $orderway eq 'DESC' }selected="selected"{/if}>{l s='--'}</option>
			<option value="{$link->goLink('price',     'asc')|escape:'htmlall':'UTF-8'}" {if $orderby eq 'price'    AND $orderway eq 'ASC' }selected="selected"{/if}>{l s='price: lowest first'}</option>
			<option value="{$link->goLink('price',    'desc')|escape:'htmlall':'UTF-8'}" {if $orderby eq 'price'    AND $orderway eq 'DESC'}selected="selected"{/if}>{l s='price: highest first'}</option>
			<option value="{$link->goLink('name',      'asc')|escape:'htmlall':'UTF-8'}" {if $orderby eq 'name'     AND $orderway eq 'ASC' }selected="selected"{/if}>{l s='name: A to Z'}</option>
			<option value="{$link->goLink('name',     'desc')|escape:'htmlall':'UTF-8'}" {if $orderby eq 'name'     AND $orderway eq 'DESC'}selected="selected"{/if}>{l s='name: Z to A'}</option>
			<option value="{$link->goLink('quantity', 'DESC')|escape:'htmlall':'UTF-8'}" {if $orderby eq 'quantity' AND $orderway eq 'DESC' }selected="selected"{/if}>{l s='in-stock first'}</option>
			<option value="{$link->goLink('quantity',  'ASC')|escape:'htmlall':'UTF-8'}" {if $orderby eq 'quantity' AND $orderway eq 'ASC'}selected="selected"{/if}>{l s='out-of-stock first'}</option>
		</select>
		<label for="selectPrductSort">{l s='sort by'}</label>
	</p>
</form>
<!-- /Sort products -->
{/if}
